function ajax(mathod,url,param){
    return new Promise((resolve,reject)=>{
        let xhr = new XMLHttpRequest()
        xhr.open(mathod,url,true)
        xhr.setRequestHeader('Content-Type',"application/x-www-form-urlencoded")
        xhr.send(param)
        xhr.onload = function(){
            if(xhr.status>=200 && xhr.status<300){
               resolve(JSON.parse(xhr.responseText))
            }else{
                reject()
            }
        }

    })
}